package com.example.chatroom.controller;

import com.example.chatroom.entity.Message;
import com.example.chatroom.websocket.WebSocketServer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.logging.Logger;

@RestController
@RequestMapping("/")
public class Instruction {

    @RequestMapping("")
    String home(){
        return "Welcome to my chat room!";
    }
    @RequestMapping("instruction")
    String instruction(){
        Logger logger = Logger.getLogger("Welcome to the page of instruction!");
        logger.info("Welcome to the page of instruction!");
        return "Now I will teach you how to use our chat room!";
    }
    @PostMapping("/sendMessage/{id}")
    public String sendMessage(@PathVariable int id,
            String content){
        System.out.println(content);
        return "I get it , you mean : " +  id + "背叛了我们，我们需要" + content;
    }
}
